package com.spring.sunflower.bottompanel;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.spring.sunflower.R;
import com.spring.sunflower.base.AppBaseFragment;

/**
 * Created by zejian
 * Time  16/1/7 上午10:26
 * Email shinezejian@163.com
 * Description:
 */
public class Fragment1 extends AppBaseFragment {
    //传递过来的参数Bundle，供子类使用
//    protected Bundle args;
//
//    /**
//     * 创建fragment的静态方法，方便传递参数
//     * @param args 传递的参数
//     * @return
//     */
//    public static <T extends Fragment>T newInstance(Class clazz,Bundle args) {
//        T mFragment=null;
//        try {
//            mFragment= (T) clazz.newInstance();
//        } catch (java.lang.InstantiationException e) {
//            e.printStackTrace();
//        } catch (IllegalAccessException e) {
//            e.printStackTrace();
//        }
//        mFragment.setArguments(args);
//        return mFragment;
//    }
//
//    /**
//     * 初始创建Fragment对象时调用
//     * @param savedInstanceState
//     */
//    @Override
//    public void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        args = getArguments();
//    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView=LayoutInflater.from(getActivity()).inflate(R.layout.fragment1,null);
        TextView tv= (TextView) rootView.findViewById(R.id.tv);

        tv.setText(args.getString("Interge"));
        return rootView ;
    }
}
